﻿using BalloonShop.App_Code;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BalloonShop.UserControls
{
    public partial class DepartmentsList : System.Web.UI.UserControl
    {
        //在DataList中载入门类信息
        protected void Page_Load(object sender, EventArgs e)
        {
            //CatalogAccess.GetDepartments将返回一个包含门类数据的DataTable对象。
            //他将读取DataList的ItemTemplate
            list.DataSource = CatalogAccess.GetDepartments();
            //需要将数据绑定控件与数据源绑定起来
            list.DataBind();
        }
        public string GetDepartment(string departmentId) {
            return Link.ToDepartment(departmentId);
        }
    }
}